(function(){
	var quanxuan =$("th input[type=checkbox]"),
		piliang=$("#piliang"),
		meige=$("tbody td input[type=checkbox]");
	quanxuan.on("click",fanxuan);
	function fanxuan(){
		for(var i=0;i<meige.length;i++){
			if(meige[i].checked==true){
				$(meige[i]).removeProp("checked","checked");
			}else{
				$(meige[i]).prop("checked","checked");
			}
		}
	}
	piliang.on("click",function(){
		$("tbody input[type='checkbox']").each(function(){
			if($(this).prop("checked")){
				$(this).parent().parent().remove();
			}
		})

	})/**不能同时删除***/
	var shanchu =$("#shanchu");
	shanchu.on("click",function(){
		var that =this;
		shanchu1.css("display","block");
		querenshanchu.text("确定要删除该作品，删除后将不可恢复。");
		o5_dele.on("click",function(){
			shanchu1.css("display","none");
		})
		o5_ok.on("click",function(){
			$(that).parent().parent().remove();
			shanchu1.css("display","none");
			shanchu2.css("display","block");
		})
		o5_no.on("click",function(){
			shanchu1.css("display","none");
		})
	})
	//**总计多少订单****/
	var zongji =$("#zongji");
	zongji.text($("table tbody tr").length);
	/***遮罩层****/
	var bianhong =$(".bianhong"),
		shanchu2=$("#shanchu2"),
		chacha=$("#chacha"),
		o5_ok=$("#o5_ok"),
		o5_dele=$("#o5_dele"),
		o5_no=$("#o5_no"),
		querenshanchu=$("#querenshanchu"),
		shanchu1=$("#shanchu1"),
		shanchuchenggong=$("#shanchuchenggong");
	bianhong.on("click",function(){
		shanchu2.css("display","block");
		shanchuchenggong.text(bianhong.text());
	})
	chacha.on("click",function(){
		shanchu2.css("display","none");
	})


	/*************添加至购物车***********/
	$(".addto_spcart").click(function () {
		$(".woddz_mask").show();
  });


    $(".genre_mark > span").click(function () {
        $(this).parent().parent().hide();
    });
    
    $(".btn_150").click(function() {
    	$(this).parent().parent().parent().parent().hide();
    });
})();
